package com.xrtn.job;

import com.xrtn.bean.TBookingInfo;
import com.xrtn.service.ICommonService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by tu_pei on 2018/5/10.
 * 每小时第35分钟执行
 * 查询未接诊预约列表
 */
public class BookingWholePointJob {
    @Autowired
    private ICommonService commonService;

    public void work(){
        Map<String,Object> params = new HashMap<>();
        params.put("minute", 35);
        params.put("bookingStatus", 0);
        List<TBookingInfo> bookingList = commonService.selectOverBooking(params);
        for (TBookingInfo bookingInfo : bookingList){
            bookingInfo.setBookingStatus(1);
            commonService.updateBookingInfo(bookingInfo);
        }

    }
}
